<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<META name="generator" content="HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org">
<TITLE>How are they run?</TITLE>
<META name="GENERATOR" content="Modular DocBook HTML Stylesheet Version 1.79">
<LINK rel="HOME" title="Abyss Web Server For Windows User's Guide" href="index.html">
<LINK rel="UP" title="CGI, FastCGI, and ISAPI" href="scripting.html">
<LINK rel="PREVIOUS" title="CGI, FastCGI, and ISAPI" href="scripting.html">
<LINK rel="NEXT" title="CGI environment variables" href="cgivars.html">
<LINK rel="STYLESHEET" type="text/css" href="stylesheet.css">
<META name="AppleIcon" content="icon.png">
<META name="AppleTitle" content="How are they run?">
<META name="Description" content="How are they run?">
<META name="AppleOrder" content="">
</HEAD>
<BODY class="SECT1" bgcolor="#FFFFFF" text="#000000">
<DIV class="NAVHEADER">
<TABLE summary="Header navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TH colspan="3" align="center">Abyss Web Server For Windows User's Guide</TH>
</TR>
<TR>
<TD width="10%" align="left" valign="bottom"><A href="scripting.html" accesskey="P">Prev</A></TD>
<TD width="80%" align="center" valign="bottom">Chapter 6. CGI, FastCGI, and ISAPI</TD>
<TD width="10%" align="right" valign="bottom"><A href="cgivars.html" accesskey="N">Next</A></TD>
</TR>
</TABLE>
<HR align="left" width="100%"></DIV>
<DIV class="SECT1">
<H1 class="SECT1"><A name="CGIINTERNALS" id="CGIINTERNALS">How are they run?</A></H1>
<P>When the server is asked for a document, it first checks if it is a script. Scripts must belong to one of the script paths or their subpaths, or must match with one of the path patterns listed in the Script Paths table.</P>
<P>Abyss Web Server is able to run standalone CGI or FastCGI executables. These executables can be GUI or non-GUI Windows applications or MS-DOS EXE or COM programs. The <B class="GUILABEL">Script Paths</B> table must contain explicitly the general patterns <KBD class="USERINPUT">/*.exe</KBD> and/or <KBD class="USERINPUT">/*.com</KBD> (or more path restrictive patterns ending with <KBD class="USERINPUT">*.exe</KBD> and/or <KBD class="USERINPUT">*.com</KBD>) in order to have them executed. Otherwise, the executable files are downloaded to the client browser.</P>
<P>Abyss Web Server can also run standalone ISAPI extensions. The <B class="GUILABEL">Script Paths</B> table must contain explicitly the virtual path of a module or a matching pattern to have it executed. A file is considered as being an ISAPI module if its file name extension matches one of the declared ISAPI file name extensions.</P>
<P>For other kinds of scripts, the server tries to find the suitable interpreter able to run them by:</P>
<UL>
<LI>
<P>Checking the <B class="GUILABEL">Interpreters</B> table and trying to match the script's extension with a declared interpreter.</P>
</LI>
<LI>
<P>Using the Windows Registry to match the script's extension with an available interpreter.</P>
</LI>
<LI>
<P>Reading the first line of the script. If it begins with <KBD class="USERINPUT">#!</KBD>, the rest of the line must contain a valid interpreter path.</P>
</LI>
</UL>
<P>If none of these steps is successful, the file is considered as a normal document and will be sent to the browser.</P>
<P>Abyss Web Server automatically detects NPH (Non Parsed Headers) scripts. NPH scripts output is sent directly to the browser without prior header decoding by the server. It is up to NPH scripts to generate correctly all the necessary HTTP response headers. Abyss Web Server considers a script to be NPH if the first line it outputs starts with the string <KBD class="USERINPUT">HTTP/</KBD>.</P>
</DIV>
<DIV class="NAVFOOTER">
<HR align="left" width="100%">
<TABLE summary="Footer navigation table" width="100%" border="0" cellpadding="0" cellspacing="0">
<TR>
<TD width="33%" align="left" valign="top"><A href="scripting.html" accesskey="P">Prev</A></TD>
<TD width="34%" align="center" valign="top"><A href="index.html" accesskey="H">Home</A></TD>
<TD width="33%" align="right" valign="top"><A href="cgivars.html" accesskey="N">Next</A></TD>
</TR>
<TR>
<TD width="33%" align="left" valign="top">CGI, FastCGI, and ISAPI</TD>
<TD width="34%" align="center" valign="top"><A href="scripting.html" accesskey="U">Up</A></TD>
<TD width="33%" align="right" valign="top">CGI environment variables</TD>
</TR>
</TABLE>
</DIV>
<DIV class="COPYRIGHT">Copyright &copy; 2001-2009 Aprelium</DIV>
</BODY>
</HTML>
